# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.NotificationEndpointGrpcSettings do
  @moduledoc """
  Represents a gRPC setting that describes one gRPC notification endpoint and the retry duration attempting to send notification to this endpoint.

  ## Attributes

  *   `authority` (*type:* `String.t`, *default:* `nil`) - Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3
  *   `endpoint` (*type:* `String.t`, *default:* `nil`) - Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name.
  *   `payloadName` (*type:* `String.t`, *default:* `nil`) - Optional. If specified, this field is used to populate the "name" field in gRPC requests.
  *   `resendInterval` (*type:* `GoogleApi.Compute.V1.Model.Duration.t`, *default:* `nil`) - Optional. This field is used to configure how often to send a full update of all non-healthy backends. If unspecified, full updates are not sent. If specified, must be in the range between 600 seconds to 3600 seconds. Nanos are disallowed. Can only be set for regional notification endpoints.
  *   `retryDurationSec` (*type:* `integer()`, *default:* `nil`) - How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authority => String.t() | nil,
          :endpoint => String.t() | nil,
          :payloadName => String.t() | nil,
          :resendInterval => GoogleApi.Compute.V1.Model.Duration.t() | nil,
          :retryDurationSec => integer() | nil
        }

  field(:authority)
  field(:endpoint)
  field(:payloadName)
  field(:resendInterval, as: GoogleApi.Compute.V1.Model.Duration)
  field(:retryDurationSec)
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.NotificationEndpointGrpcSettings do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.NotificationEndpointGrpcSettings.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.NotificationEndpointGrpcSettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
